package fast.calc.druid;

import fast.calc.AttackType;
import fast.calc.Attacks;
import fast.calc.AttacksBlock;
import fast.calc.WeaponStats;
import fast.data.Stat;

public class AttacksDruid extends Attacks {
	
	double spellScaling90 = 1094.739746093750000;
		
	public AttacksDruid(FastDruid f){
		super(f);
		spellScaling = spellScaling90;
	}
	
	public AttacksBlock get_dmg_mh(){
		WeaponStats w = s.getMh();
		double damage = w.getDps() + s.getBuffed(Stat.ap) / 14.;
		double crit_damage = damage * s.getCritMultiplier();
		return new AttacksBlock("mh",AttackType.physical,damage, crit_damage);
	}
	
	public double get_crit_mh(){
		double crit_chance = s.getCritPercent();
		return crit_chance;
	}
	
	public AttacksBlock get_dmg_ferocious_bite(){
		double avg = 0.4569999874 * spellScaling;
		double min = avg * ( 1 - 0.7400000095 / 2);
		double max = avg * ( 1 + 0.7400000095 / 2);
		double bonus_damage = 0.6959999800 * spellScaling;
		
		double damage = ((min+max)/2 + (bonus_damage + (s.getBuffed(Stat.ap) * 0.196)) * 5);
		double crit_damage = damage * s.getCritMultiplier();
		return new AttacksBlock("ferocious_bite",AttackType.physical,damage, crit_damage);
	}
	
	public double get_crit_ferocious_bite(){
		return get_crit_mh();
	}
	
	public AttacksBlock get_dmg_shred(){
		WeaponStats w = s.getMh();
		double damage = w.getDps() + s.getBuffed(Stat.ap) / 14.;
		double mod = 4.00;
		double base_damage = 0.0570000000 * spellScaling;
		damage = (damage + base_damage) * mod;
		damage *= 1.2; // against bleed targets
		double crit_damage = damage * s.getCritMultiplier();
		return new AttacksBlock("shred",AttackType.physical,damage, crit_damage);
	}
	
	public double get_crit_shred(){
		return get_crit_mh();
	}
	
	public AttacksBlock get_dmg_rip(){
		double base_damage = 0.1030000001 * spellScaling;
		double bonus_damage = 0.2919999957 * spellScaling;
		
		double damage = base_damage + bonus_damage * 5 + 0.0484 * 5 * (s.getBuffed(Stat.ap)+getExtraFeralAttackPower());
		double crit_damage = damage * s.getCritMultiplier();
		return new AttacksBlock("rip",AttackType.bleed, damage, crit_damage);
	}
	
	public double get_crit_rip(){
		return get_crit_mh();
	}
	
	public AttacksBlock get_dmg_rake(){
		double damage = 0.1080000028 * spellScaling + 0.368 * (s.getBuffed(Stat.ap)+getExtraFeralAttackPower());
				
		double crit_damage = damage * s.getCritMultiplier();
		return new AttacksBlock("rake",AttackType.bleed, damage, crit_damage);
	}
	
	public double get_crit_rake(){
		return get_crit_mh();
	}
	
	public AttacksBlock get_dmg_rake_dot(){
		double damage = 0.1080000028 * spellScaling + 0.368 * (s.getBuffed(Stat.ap)+getExtraFeralAttackPower());
		
		double crit_damage = damage * s.getCritMultiplier();
		return new AttacksBlock("rake_dot",AttackType.bleed, damage, crit_damage);
	}
	
	public double get_crit_rake_dot(){
		return get_crit_mh();
	}
	
	private double getExtraFeralAttackPower(){
		WeaponStats mh = s.getMh();
		return mh.getDps();
	}
}

